template(name="swimlane")
  .swimlane
    +swimlaneHeader
  unless collapseSwimlane
    .swimlane.js-lists.js-swimlane(id="swimlane-{{_id}}")
      if isMiniScreen
        if currentListIsInThisSwimlane _id
          +list(currentList)
        unless currentList
          each lists
            +miniList(this)
          if currentUser.isBoardMember
            unless currentUser.isCommentOnly
              +addListForm
      else
        each lists
          +list(this)
          if currentCardIsInThisList _id ../_id
            +cardDetails(currentCard)
        if currentUser.isBoardMember
          unless currentUser.isCommentOnly
            +addListForm

template(name="listsGroup")
  .swimlane.list-group.js-lists
    if isMiniScreen
      if currentList
        +list(currentList)
      else
        each lists
          +miniList(this)
        if currentUser.isBoardMember
          unless currentUser.isCommentOnly
            +addListForm
    else
      each lists
        if visible this
          +list(this)
        if currentCardIsInThisList _id null
          +cardDetails(currentCard)
      if currentUser.isBoardMember
        unless currentUser.isCommentOnly
          +addListForm

template(name="addListForm")
  unless currentUser.isWorker
    .list.list-composer.js-list-composer(class="{{#if isMiniScreen}}mini-list{{/if}}")
      if currentUser.isBoardAdmin
        .list-header-add
          +inlinedForm(autoclose=false)
            input.list-name-input.full-line(type="text" placeholder="{{_ 'add-list'}}"
              autocomplete="off" autofocus)
            .edit-controls.clearfix
              button.primary.confirm(type="submit") {{_ 'save'}}
              unless currentBoard.isTemplatesBoard
                unless currentBoard.isTemplateBoard
                  span.quiet
                    | {{_ 'or'}}
                    a.js-list-template {{_ 'template'}}
          else
            a.open-list-composer.js-open-inlined-form
              i.fa.fa-plus
              | {{_ 'add-list'}}
